<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="inc/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript"
	src="http://www.luqidong.com/demo/qrcode/js/qrcode.js"></script>

<jsp:include page="inc/meta.jsp"></jsp:include>
<link href="${ctx}/static/css/style.css" rel="stylesheet">
<title>登录</title>
<script type="text/javascript" src="${ctx}/static/js/selectivizr.js"></script>
<script type="text/javascript">
	$(function() {
		$('input[name="submit"]')
				.click(
						function() {
							var name = $('input[name="username"]').val();
							var passwd = $('input[name="password"]').val();
							if ($.trim(name) == "") {
								$('#msg').html("提示：登录名不能为空！");
								return;
							}
							if (passwd == "") {
								$('#msg').html("提示：密码不能为空！");
								return;
							}
							$('#msg').html("正在提交");
							$.ajax({
										type : "POST",
										url : "${ctx}/login/LoginHandlerServlet.do",
										data : "name=" + name + "&passwd="
												+ passwd,
										success : function(msg) {
											// alert( "Data Saved: " + msg );
											$('#msg').html(msg);
											if (msg == "此用户密码不对"
													|| msg == "系统中不存在此用户") {
												return;
											}
											window.location.href = "${ctx}/login/LoginIndexRequestServlet.do";
										}
									});
						});
	});
</script>
</head>
<body>
	<nav class="navbar navbar-default navbar-inverse" role="navigation">
	<div class="container-fluid">
		<div class="navbar-header">
			<a class="navbar-brand" href="#"> <img
				alt="G3后台管理系统">
			</a>
		</div>
	</div>
	</nav>
	<div id="container">
		<form class="form-signin" method="post">	
			<div class="login">登录</div>
			<div class="username-text">用户名:
			
			</div>
			<div class="password-text">密码:</div>
			<div class="username-field">
				<input type="text" name="username"  />
			</div>
			<div class="password-field">
				<input type="password" name="password"  />
			</div>
			<div id="msg"></div>
			<input type="checkbox" name="remember-me" id="remember-me" /><label
				for="remember-me">记住我</label>
			<div class="forgot-usr-pwd">
				忘记 <a href="#">用户名</a> or <a href="#">密码</a>? <span class="dotted">|</span>
				<a href="${ctx}/login/RegisterServlet.do?method=initForm&userid=0">新账号注册</a>
				<span class="dotted">|</span>
			</div>
			<input type="button" name="submit" value="GO" />
			
		</form>
		<div id="footer">欢迎使用G3后台管理系统</div>
	</div>
</body>
</html>